#pragma once
// MESSAGE HEARTBEAT PACKING

#define MAVLINK_MSG_ID_HEARTBEAT 0

MAVPACKED(
typedef struct __mavlink_heartbeat_t {
 float cpu_load; /*<  System CPU load*/
 uint8_t system_status; /*<  System status flag, see MAV_STATE ENUM*/
 uint8_t mavlink_version; /*<  MAVLink version*/
 uint8_t motor_status; /*<  motor status*/
 uint8_t imu_status; /*<  imu status*/
 uint8_t beacon_status; /*<  beacon status*/
 uint8_t attitude_ctrl_status; /*<  attitude control status*/
 uint8_t signal_ctrl_status; /*<  signal control status*/
 uint8_t antenna_version[50]; /*<  antenna version.*/
 uint8_t software_version[50]; /*<  software version.*/
}) mavlink_heartbeat_t;

#define MAVLINK_MSG_ID_HEARTBEAT_LEN 111
#define MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN 111
#define MAVLINK_MSG_ID_0_LEN 111
#define MAVLINK_MSG_ID_0_MIN_LEN 111

#define MAVLINK_MSG_ID_HEARTBEAT_CRC 125
#define MAVLINK_MSG_ID_0_CRC 125

#define MAVLINK_MSG_HEARTBEAT_FIELD_ANTENNA_VERSION_LEN 50
#define MAVLINK_MSG_HEARTBEAT_FIELD_SOFTWARE_VERSION_LEN 50

#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_HEARTBEAT { \
    0, \
    "HEARTBEAT", \
    10, \
    {  { "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, system_status) }, \
         { "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, mavlink_version) }, \
         { "cpu_load", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_heartbeat_t, cpu_load) }, \
         { "motor_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, motor_status) }, \
         { "imu_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, imu_status) }, \
         { "beacon_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, beacon_status) }, \
         { "attitude_ctrl_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_heartbeat_t, attitude_ctrl_status) }, \
         { "signal_ctrl_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_heartbeat_t, signal_ctrl_status) }, \
         { "antenna_version", NULL, MAVLINK_TYPE_UINT8_T, 50, 11, offsetof(mavlink_heartbeat_t, antenna_version) }, \
         { "software_version", NULL, MAVLINK_TYPE_UINT8_T, 50, 61, offsetof(mavlink_heartbeat_t, software_version) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_HEARTBEAT { \
    "HEARTBEAT", \
    10, \
    {  { "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, system_status) }, \
         { "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, mavlink_version) }, \
         { "cpu_load", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_heartbeat_t, cpu_load) }, \
         { "motor_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, motor_status) }, \
         { "imu_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, imu_status) }, \
         { "beacon_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, beacon_status) }, \
         { "attitude_ctrl_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_heartbeat_t, attitude_ctrl_status) }, \
         { "signal_ctrl_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_heartbeat_t, signal_ctrl_status) }, \
         { "antenna_version", NULL, MAVLINK_TYPE_UINT8_T, 50, 11, offsetof(mavlink_heartbeat_t, antenna_version) }, \
         { "software_version", NULL, MAVLINK_TYPE_UINT8_T, 50, 61, offsetof(mavlink_heartbeat_t, software_version) }, \
         } \
}
#endif

/**
 * @brief Pack a heartbeat message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param system_status  System status flag, see MAV_STATE ENUM
 * @param mavlink_version  MAVLink version
 * @param cpu_load  System CPU load
 * @param motor_status  motor status
 * @param imu_status  imu status
 * @param beacon_status  beacon status
 * @param attitude_ctrl_status  attitude control status
 * @param signal_ctrl_status  signal control status
 * @param antenna_version  antenna version.
 * @param software_version  software version.
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               uint8_t system_status, uint8_t mavlink_version, float cpu_load, uint8_t motor_status, uint8_t imu_status, uint8_t beacon_status, uint8_t attitude_ctrl_status, uint8_t signal_ctrl_status, const uint8_t *antenna_version, const uint8_t *software_version)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
    _mav_put_float(buf, 0, cpu_load);
    _mav_put_uint8_t(buf, 4, system_status);
    _mav_put_uint8_t(buf, 5, mavlink_version);
    _mav_put_uint8_t(buf, 6, motor_status);
    _mav_put_uint8_t(buf, 7, imu_status);
    _mav_put_uint8_t(buf, 8, beacon_status);
    _mav_put_uint8_t(buf, 9, attitude_ctrl_status);
    _mav_put_uint8_t(buf, 10, signal_ctrl_status);
    _mav_put_uint8_t_array(buf, 11, antenna_version, 50);
    _mav_put_uint8_t_array(buf, 61, software_version, 50);
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN);
#else
    mavlink_heartbeat_t packet;
    packet.cpu_load = cpu_load;
    packet.system_status = system_status;
    packet.mavlink_version = mavlink_version;
    packet.motor_status = motor_status;
    packet.imu_status = imu_status;
    packet.beacon_status = beacon_status;
    packet.attitude_ctrl_status = attitude_ctrl_status;
    packet.signal_ctrl_status = signal_ctrl_status;
    mav_array_memcpy(packet.antenna_version, antenna_version, sizeof(uint8_t)*50);
    mav_array_memcpy(packet.software_version, software_version, sizeof(uint8_t)*50);
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
}

/**
 * @brief Pack a heartbeat message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param system_status  System status flag, see MAV_STATE ENUM
 * @param mavlink_version  MAVLink version
 * @param cpu_load  System CPU load
 * @param motor_status  motor status
 * @param imu_status  imu status
 * @param beacon_status  beacon status
 * @param attitude_ctrl_status  attitude control status
 * @param signal_ctrl_status  signal control status
 * @param antenna_version  antenna version.
 * @param software_version  software version.
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   uint8_t system_status,uint8_t mavlink_version,float cpu_load,uint8_t motor_status,uint8_t imu_status,uint8_t beacon_status,uint8_t attitude_ctrl_status,uint8_t signal_ctrl_status,const uint8_t *antenna_version,const uint8_t *software_version)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
    _mav_put_float(buf, 0, cpu_load);
    _mav_put_uint8_t(buf, 4, system_status);
    _mav_put_uint8_t(buf, 5, mavlink_version);
    _mav_put_uint8_t(buf, 6, motor_status);
    _mav_put_uint8_t(buf, 7, imu_status);
    _mav_put_uint8_t(buf, 8, beacon_status);
    _mav_put_uint8_t(buf, 9, attitude_ctrl_status);
    _mav_put_uint8_t(buf, 10, signal_ctrl_status);
    _mav_put_uint8_t_array(buf, 11, antenna_version, 50);
    _mav_put_uint8_t_array(buf, 61, software_version, 50);
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN);
#else
    mavlink_heartbeat_t packet;
    packet.cpu_load = cpu_load;
    packet.system_status = system_status;
    packet.mavlink_version = mavlink_version;
    packet.motor_status = motor_status;
    packet.imu_status = imu_status;
    packet.beacon_status = beacon_status;
    packet.attitude_ctrl_status = attitude_ctrl_status;
    packet.signal_ctrl_status = signal_ctrl_status;
    mav_array_memcpy(packet.antenna_version, antenna_version, sizeof(uint8_t)*50);
    mav_array_memcpy(packet.software_version, software_version, sizeof(uint8_t)*50);
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
}

/**
 * @brief Encode a heartbeat struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param heartbeat C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat)
{
    return mavlink_msg_heartbeat_pack(system_id, component_id, msg, heartbeat->system_status, heartbeat->mavlink_version, heartbeat->cpu_load, heartbeat->motor_status, heartbeat->imu_status, heartbeat->beacon_status, heartbeat->attitude_ctrl_status, heartbeat->signal_ctrl_status, heartbeat->antenna_version, heartbeat->software_version);
}

/**
 * @brief Encode a heartbeat struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param heartbeat C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_heartbeat_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat)
{
    return mavlink_msg_heartbeat_pack_chan(system_id, component_id, chan, msg, heartbeat->system_status, heartbeat->mavlink_version, heartbeat->cpu_load, heartbeat->motor_status, heartbeat->imu_status, heartbeat->beacon_status, heartbeat->attitude_ctrl_status, heartbeat->signal_ctrl_status, heartbeat->antenna_version, heartbeat->software_version);
}

/**
 * @brief Send a heartbeat message
 * @param chan MAVLink channel to send the message
 *
 * @param system_status  System status flag, see MAV_STATE ENUM
 * @param mavlink_version  MAVLink version
 * @param cpu_load  System CPU load
 * @param motor_status  motor status
 * @param imu_status  imu status
 * @param beacon_status  beacon status
 * @param attitude_ctrl_status  attitude control status
 * @param signal_ctrl_status  signal control status
 * @param antenna_version  antenna version.
 * @param software_version  software version.
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t system_status, uint8_t mavlink_version, float cpu_load, uint8_t motor_status, uint8_t imu_status, uint8_t beacon_status, uint8_t attitude_ctrl_status, uint8_t signal_ctrl_status, const uint8_t *antenna_version, const uint8_t *software_version)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
    _mav_put_float(buf, 0, cpu_load);
    _mav_put_uint8_t(buf, 4, system_status);
    _mav_put_uint8_t(buf, 5, mavlink_version);
    _mav_put_uint8_t(buf, 6, motor_status);
    _mav_put_uint8_t(buf, 7, imu_status);
    _mav_put_uint8_t(buf, 8, beacon_status);
    _mav_put_uint8_t(buf, 9, attitude_ctrl_status);
    _mav_put_uint8_t(buf, 10, signal_ctrl_status);
    _mav_put_uint8_t_array(buf, 11, antenna_version, 50);
    _mav_put_uint8_t_array(buf, 61, software_version, 50);
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
#else
    mavlink_heartbeat_t packet;
    packet.cpu_load = cpu_load;
    packet.system_status = system_status;
    packet.mavlink_version = mavlink_version;
    packet.motor_status = motor_status;
    packet.imu_status = imu_status;
    packet.beacon_status = beacon_status;
    packet.attitude_ctrl_status = attitude_ctrl_status;
    packet.signal_ctrl_status = signal_ctrl_status;
    mav_array_memcpy(packet.antenna_version, antenna_version, sizeof(uint8_t)*50);
    mav_array_memcpy(packet.software_version, software_version, sizeof(uint8_t)*50);
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
#endif
}

/**
 * @brief Send a heartbeat message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_heartbeat_send_struct(mavlink_channel_t chan, const mavlink_heartbeat_t* heartbeat)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_heartbeat_send(chan, heartbeat->system_status, heartbeat->mavlink_version, heartbeat->cpu_load, heartbeat->motor_status, heartbeat->imu_status, heartbeat->beacon_status, heartbeat->attitude_ctrl_status, heartbeat->signal_ctrl_status, heartbeat->antenna_version, heartbeat->software_version);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)heartbeat, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
#endif
}

#if MAVLINK_MSG_ID_HEARTBEAT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_heartbeat_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t system_status, uint8_t mavlink_version, float cpu_load, uint8_t motor_status, uint8_t imu_status, uint8_t beacon_status, uint8_t attitude_ctrl_status, uint8_t signal_ctrl_status, const uint8_t *antenna_version, const uint8_t *software_version)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_float(buf, 0, cpu_load);
    _mav_put_uint8_t(buf, 4, system_status);
    _mav_put_uint8_t(buf, 5, mavlink_version);
    _mav_put_uint8_t(buf, 6, motor_status);
    _mav_put_uint8_t(buf, 7, imu_status);
    _mav_put_uint8_t(buf, 8, beacon_status);
    _mav_put_uint8_t(buf, 9, attitude_ctrl_status);
    _mav_put_uint8_t(buf, 10, signal_ctrl_status);
    _mav_put_uint8_t_array(buf, 11, antenna_version, 50);
    _mav_put_uint8_t_array(buf, 61, software_version, 50);
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
#else
    mavlink_heartbeat_t *packet = (mavlink_heartbeat_t *)msgbuf;
    packet->cpu_load = cpu_load;
    packet->system_status = system_status;
    packet->mavlink_version = mavlink_version;
    packet->motor_status = motor_status;
    packet->imu_status = imu_status;
    packet->beacon_status = beacon_status;
    packet->attitude_ctrl_status = attitude_ctrl_status;
    packet->signal_ctrl_status = signal_ctrl_status;
    mav_array_memcpy(packet->antenna_version, antenna_version, sizeof(uint8_t)*50);
    mav_array_memcpy(packet->software_version, software_version, sizeof(uint8_t)*50);
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)packet, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
#endif
}
#endif

#endif

// MESSAGE HEARTBEAT UNPACKING


/**
 * @brief Get field system_status from heartbeat message
 *
 * @return  System status flag, see MAV_STATE ENUM
 */
static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  4);
}

/**
 * @brief Get field mavlink_version from heartbeat message
 *
 * @return  MAVLink version
 */
static inline uint8_t mavlink_msg_heartbeat_get_mavlink_version(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  5);
}

/**
 * @brief Get field cpu_load from heartbeat message
 *
 * @return  System CPU load
 */
static inline float mavlink_msg_heartbeat_get_cpu_load(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  0);
}

/**
 * @brief Get field motor_status from heartbeat message
 *
 * @return  motor status
 */
static inline uint8_t mavlink_msg_heartbeat_get_motor_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  6);
}

/**
 * @brief Get field imu_status from heartbeat message
 *
 * @return  imu status
 */
static inline uint8_t mavlink_msg_heartbeat_get_imu_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  7);
}

/**
 * @brief Get field beacon_status from heartbeat message
 *
 * @return  beacon status
 */
static inline uint8_t mavlink_msg_heartbeat_get_beacon_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  8);
}

/**
 * @brief Get field attitude_ctrl_status from heartbeat message
 *
 * @return  attitude control status
 */
static inline uint8_t mavlink_msg_heartbeat_get_attitude_ctrl_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  9);
}

/**
 * @brief Get field signal_ctrl_status from heartbeat message
 *
 * @return  signal control status
 */
static inline uint8_t mavlink_msg_heartbeat_get_signal_ctrl_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  10);
}

/**
 * @brief Get field antenna_version from heartbeat message
 *
 * @return  antenna version.
 */
static inline uint16_t mavlink_msg_heartbeat_get_antenna_version(const mavlink_message_t* msg, uint8_t *antenna_version)
{
    return _MAV_RETURN_uint8_t_array(msg, antenna_version, 50,  11);
}

/**
 * @brief Get field software_version from heartbeat message
 *
 * @return  software version.
 */
static inline uint16_t mavlink_msg_heartbeat_get_software_version(const mavlink_message_t* msg, uint8_t *software_version)
{
    return _MAV_RETURN_uint8_t_array(msg, software_version, 50,  61);
}

/**
 * @brief Decode a heartbeat message into a struct
 *
 * @param msg The message to decode
 * @param heartbeat C-struct to decode the message contents into
 */
static inline void mavlink_msg_heartbeat_decode(const mavlink_message_t* msg, mavlink_heartbeat_t* heartbeat)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    heartbeat->cpu_load = mavlink_msg_heartbeat_get_cpu_load(msg);
    heartbeat->system_status = mavlink_msg_heartbeat_get_system_status(msg);
    heartbeat->mavlink_version = mavlink_msg_heartbeat_get_mavlink_version(msg);
    heartbeat->motor_status = mavlink_msg_heartbeat_get_motor_status(msg);
    heartbeat->imu_status = mavlink_msg_heartbeat_get_imu_status(msg);
    heartbeat->beacon_status = mavlink_msg_heartbeat_get_beacon_status(msg);
    heartbeat->attitude_ctrl_status = mavlink_msg_heartbeat_get_attitude_ctrl_status(msg);
    heartbeat->signal_ctrl_status = mavlink_msg_heartbeat_get_signal_ctrl_status(msg);
    mavlink_msg_heartbeat_get_antenna_version(msg, heartbeat->antenna_version);
    mavlink_msg_heartbeat_get_software_version(msg, heartbeat->software_version);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_HEARTBEAT_LEN? msg->len : MAVLINK_MSG_ID_HEARTBEAT_LEN;
        memset(heartbeat, 0, MAVLINK_MSG_ID_HEARTBEAT_LEN);
    memcpy(heartbeat, _MAV_PAYLOAD(msg), len);
#endif
}
